<?php
	require("includes/basic.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
	<HEAD>
		<TITLE> :: <?php echo $appName?> :: </TITLE>
		<link rel='stylesheet' type='text/css' href='style/admin.css'>
		<script type='text/javascript' src='js/general.js'></script>
		<script type='text/javascript' src='js/help.js'></script>
		<script type='text/javascript' src='js/list.js'></script>
		<script type='text/javascript' src='js/jquery-latest.js'></script>
		<script type='text/javascript'>
		$(document).ready(function()
		{
			$("#projectname").change(function()
			{
				//alert('hi');
				var pid=$("#projectname").val();
				var dataString ='pid='+ pid;
				//alert(pid);
				$.ajax
				({
					type: "POST",
					url: "client-project_task.php",
					data: dataString,
					cache: false,
					success: function(html)
					{
					$("#tasks").html(html);
					} 
				});
			});

				
		});
		</script>
		<script type='text/javascript'>
			function bodyLoad() {
				setContext("This is the main administration view.");
				setActiveItemByName("/");
				loadingOff();
				try {
					document.getElementById('loaderContainerH').height = wHeight();
				} catch (e) {}
			}
			function bodyUnload() {
				loadingOn();
			}
		</script>



		

	</HEAD>

	<body onLoad='bodyLoad();' onUnload='bodyUnload();'>
		<?php $pageName="List of Projects"; ?>
		<?php require("includes/header.php"); ?>

		<!-- devi : body content begins here -->

	<table border='0' cellspacing='0' cellpadding='0' id='loaderContainer' onClick='return false;'>
		<tr><td id='loaderContainerH'><div id='loader'>
			<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td>
				<p><img src='images/wait.gif' height='32' width='32' alt=''/>
				<strong>Please wait.<br>Loading ...</strong></p>
			</td></tr></table>
		</div></td></tr>
	</table>
	<table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td id='screenH'>
		<div class='pathbar'><a href='index.php'>Admin</a> -> Projects</div>
		<div class='screenTitle'>
			<table width='100%' cellspacing='0'>
				<tr>
					<td>
						<?php echo $pageName;?>
					</td>		
				</tr>
			</table>
		</div>
<table class="dialog" cellpadding="0" cellspacing="0"><tr><td>
<table class="dialogbox" cellpadding="0" cellspacing="0">
<tr><td>
<?php if(isset($_SESSION['uid']) && $userType=='C') {
$projects=mysql_query("SELECT * FROM client_project AS cp, project_master AS pm WHERE cp.project_id = pm.project_id AND cp.client_id='0000004'
");
$noOfProjects=mysql_num_rows($projects);
$sr=1;
$class="evenrowbg";
?>
<!-- icons block area start -->
<div id='submenu'><!-- <span class="link" onClick="">&nbsp;&nbsp;<a href='#' style='white-space: nowrap;'><img src='images/add.png' alt='Add New Project' width='22' height='22' title='Add New Project'><a href='add-project.php'>Add Project</a></a></span> --></div>
<!-- icons block area end -->
<div class="dialoghead" unselectable="on"></div><div class="dialogcontent" unselectable="on">
<!-- dialogcontent start -->

<div class='help' id='helpae' onMouseOut="hMH('ae');">Click here to edit the selected group.</div>
<div class='hide' id='confae'>null</div>
<div class='help' id='helpau' onMouseOut="hMH('au');">Click here to add or remove users to this group.</div>
<div class='hide' id='confau'>null</div>
<div class='help' id='helpaa' onMouseOut="hMH('aa');">Click here to activate the selected group.</div>
<div class='hide' id='confaa'>Are you sure you want to activate the selected group?</div>
<div class='help' id='helpac' onMouseOut="hMH('ac');">Click here to deactivate the selected group.</div>
<div class='hide' id='confac'>Are you sure you want to deactivate the selected group?</div>
<div class='help' id='helpad' onMouseOut="hMH('ad');">Click here to delete the selected group.</div>
<div class='hide' id='confad'>null</div>
<div class='help' id='helpde' onMouseOut="hMH('de');">Click here to edit the selected group.</div>
<div class='hide' id='confde'>null</div>
<div class='listArea'>
<!-- 3D block start -->
<fieldset class="dialogblock">
<legend><span class="textbold" unselectable="on">Projects</span></legend>
		<table width='100%' cellspacing='0' cellpadding='0' border='0'>
			<tr><td>
			 <table width='100%' cellspacing='0'>	
				<tr>
					<td align='left'>
						Total Project Count <?php echo $noOfProjects;?>
					</td>
					<td class='misc'>
						&nbsp;
					</td>
				</tr>
				<tr><td>
				<table>
				<tr>
					<td><B>Select Project</B>&nbsp;</td>
					<td> <select name="projectname" id='projectname'>
					<option value=''>--Select--</option>
						
					<?php $q="SELECT * FROM client_project AS cp, project_master AS pm WHERE cp.project_id = pm.project_id AND cp.client_id='$userId'
					";
					$q_res=mysql_query($q);
					if(mysql_num_rows($q_res)>0)
					{
						while($row=mysql_fetch_array($q_res))
						{
							$proid=$row['project_id'];
							$proname=$row['project_name'];
					?>
							
							
										<option value="<?php echo $proid;?>"><?php echo $proname;?></option>
									
								

						<?php	 }}?>
						</select></td>
					</tr>
					</table></td></tr>
					<tr><td style="height:25px;"></td></tr>
					<tr><td id='tasks'>
					</td></tr>
					

			</table> 
			<table width='100%'><tr><td id='projects'>
			<?php include("client-project_task.php"); ?>
			</td></tr></table> </td></tr>
		</table>
			
</fieldset>

<!-- 3D block end -->
</div>


<!-- dialogcontent end -->
</div>
<?php }else{echo "<div align='center'>You are not authorised to vies this page</div>";}?>
</td></tr></table>
</td></tr></table>
<p>&nbsp;</p>
	</td></tr></table>

		<!-- devi : body content ends here -->
<table align="center">
			
		</table>
		<?php require("includes/footer.php"); ?>
	</BODY>
</HTML>
